<link rel="stylesheet" type="text/css" href="../addons/jy_renwu/resource/task.css"/>
<title>任务中心</title>
<div class="fui-page">
    <div class="fui-header" style="z-index: 99">
        <div class="fui-header-left">
            <a class="back" ng-click="goback()"></a>
        </div>
        <div class="title">奖励记录</div>
    </div>
    <div class='fui-content'>

        <div ng-if="pagedata.list.length==0" style="height: 7rem;line-height:7rem;width: 100%;text-align: center;color: #d0d0d0;font-size: 1rem">暂时没有任何奖励</div>
  
        <div ng-if="pagedata.list.length>0" class='fui-list-group'>
          
            <div ng-repeat="reward in pagedata.list" class="reward-list">
                <div class="reward-list-inner">
                    <div class="title">
                        <!--奖励图标-->
                        <i ng-if="reward.reward_type=='red'" class="iconfont icon-hongbao"></i>&yen{{reward.reward_data}}红包
                      
                        <i ng-if="reward.reward_type=='credit1'" class="iconfont icon-jifen"></i>{{reward.reward_data}}积分
                        
                        <i ng-if="reward.reward_type=='credit2'" class="iconfont icon-yue"></i>&yen{{reward.reward_data}}余额
                     
                        <i ng-if="reward.reward_type=='coupon'" class="iconfont icon-youhuiquan"></i>{{reward.reward_title}}
                        
                        <i ng-if="reward.reward_type=='goods'"  class="iconfont icon-shangpin"></i>{{reward.reward_title}}
                       
                    </div>
                    <div class="des" style="color: #ccc">
                        <span style="display:block;">{{reward.tasktitle}}</span>
                        {{reward.gettime}}
                    </div>
                </div>
                <!--领取按钮-->
                <div class="reward-list-right">
						{{ifelse(reward.reward_type=='credit1' || reward.reward_type=='credit2' ||reward.sent==1,'已发放','')}}
                        <a ng-if="reward.reward_type=='coupon'&& reward.sent!=1" href="javascript:;"  ng-click="access_json('jy_weishop/coupon.myindex/')">查看</a>                   
                        <a ng-if="reward.reward_type=='red'&& reward.sent!=1"  onclick="pagedata.getRed(reward.id)">领取</a>
                 
                        <a ng-if="reward.reward_type=='goods'&& reward.sent!=1" href="javascript:;" ng-click="access_json('jy_weishop/goods.detail//id='+reward.reward_data)">去下单</a>
                </div>
            </div>
           
        </div>
    </div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.pagedata.getRed=function (id) {
	scope.post_json('/detail/getReward/',{'detail_id':id},function(res){
		if (res.ok == 1){
			scope.message('领取成功,请到微信查收红包')
		}else{
			scope.message('红包发送失败')
		}
	});
}
</script>
